class Check < ActiveRecord::Base
  validates_presence_of :user_id, :freshman_id, :checked_at

  belongs_to :user
  belongs_to :freshman
  
  def found_actions
    actions_to_return = freshman.desk_actions.find(:all,
                                                   :conditions => ["effective_at < ?", checked_at],
    						                	   :order => "effective_at DESC",
    						                	   :limit => Constraint.getValueByKeyAndTime('ActionsPerCheck', checked_at))
    return actions_to_return
  end
end
